﻿using Framework.Models.Entities;
using Lee.Utility.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders; 

namespace Framework.EF.ModelConfigurations
{
    internal class Fw_FlowinstanceConfiguration : IEntityTypeConfiguration<Fw_Flowinstance>
    {
        public void Configure(EntityTypeBuilder<Fw_Flowinstance> entity)
        {
            entity.HasKey(e => e.Id).HasName("PRIMARY");
            entity.ToTable("Fw_Flowinstance"); 
            var entityType = typeof(Fw_Flowinstance);
            if (typeof(IsDeleted).IsAssignableFrom(entityType))
            {
                entity.HasQueryFilter(f => !f.IsDeleted);
            }
        }
    }
}
